<?php

Yii::import("ext.xupload.models.XUploadForm");

function smarty_function_xUploadWidget($params, &$smarty)
{
    $model = new XUploadForm;
    $xUploadParams = array('model' => $model,
                           'attribute' => 'file');
    $mergeParams = array_merge($params, $xUploadParams);
    
    Yii::app()->controller->widget('ext.xupload.XUploadWidget', $mergeParams);

}